<%@ page import="Jsp.User" %>
<%@ page import="java.util.*" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/11
  Time: 13:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <h2>EL 运算</h2>
    <p>$ {1+3+3}</p>
    ${1+3+3}
    <hr>
    <p>$ {3>2}</p>
    ${3>2}
    <br><hr>

    <h2>判断是否为空</h2>
    <p>$ {empty str}</p>
    ${empty str}


    <%
        request.setAttribute("msg","msg");

        request.getSession().setAttribute("msg","massage");
    %>

    <h2>从域对象获取值</h2>
<%--    先找request再找session--%>
    ${msg}

    <h2>获取对象的值</h2>

    <%
        User user=new User("名字",11,new Date());
        request.setAttribute("u",user);

    %>
    ${u}
    <br>

    ${u.name}
    <br>

    ${u.age}

    <%
        List<String> list=new ArrayList<String>();
        list.add("lily");
        list.add("tom");
        request.setAttribute("list",list);

        Map<String ,User> map=new HashMap<String,User>();
        map.put("zs",user);
        request.setAttribute("map",map);


    %>
    ${list}<br>
    ${list[0]}<br>
    $



</body>
</html>
